﻿using Microsoft.AspNetCore.Builder;
using NLog;

namespace Xman.ActivityId.Http
{
    public static class ActivityIdCollectionExtensions
    {
        public static IApplicationBuilder UseNLogActivityId(this IApplicationBuilder builder)
        {
            LogManager.Setup().SetupExtensions(ext =>{ext.RegisterLayoutRenderer<TraceActivityIdLayoutRenderer>("activityid");});
            //ConfigurationItemFactory.Default.LayoutRenderers.RegisterDefinition("activityid", typeof(TraceActivityIdLayoutRenderer));
            return builder.UseMiddleware<ActivityIdMiddleware>();
        }
    }

}
